<!-- 显示附件列表组件 -->
<!--使用: 项目评审 附件 -->
<template>
	<div style="display: flex">
		<template v-for="(item, index) in contracListUrl" :key="index">
			<div style="margin-right: 10px">
				<el-icon size="12">
					<ele-Link />
				</el-icon>
				<!-- <div v-if="item instanceof Object">
					<div>{{ item instanceof Object }}</div>
					// <a :href="`${urlStore.url}${item}`" style="color: blue; text-decoration: underline" target="_blank">{{ `附件${index + 1}` }}</a>
				</div>
				<template v-else>
					<a :href="`${urlStore.url}${item}`" style="color: blue; text-decoration: underline" target="_blank">{{ `附件${index + 1}` }}</a>
				</template> -->
				<template v-if="item instanceof Object">
					<a :href="`${urlStore.url}${item.url}`" style="color: blue; text-decoration: underline" target="_blank">{{ item.name }}</a>
				</template>
				<template v-else>
					<a :href="`${urlStore.url}${item}`" style="color: blue; text-decoration: underline" target="_blank">{{ `附件${index + 1}` }}</a>
				</template>
			</div>
		</template>
		<template v-if="contracListUrl && contracListUrl.length == 0 && !hiddenTint">
			<div>暂无附件</div>
		</template>
	</div>
</template>

<script setup lang="ts">
import { useStaffInfoStore } from '/@/stores/ys/index';

const urlStore = useStaffInfoStore();

defineProps({
	contracListUrl: {
		type: Array,
		default: () => {
			[];
		},
	},
	//是否文件命名,如果
	fileNaming: {
		type: Boolean,
		default: false,
	},
	//是否隐藏为空时的提示
	hiddenTint: {
		type: Boolean,
		default: false,
	},
});
</script>

<!-- scoped属性使style有自己独立的作用域(属性选择器实现 title[data-v-xxx]) -->
<style scoped></style>
